package com.yuanjin.main;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.yuanjin.R;
import com.yuanjin.activity.FriendsCircleActivity;
import com.yuanjin.util.Yuanjin;

public class FragmentHome extends Fragment implements OnClickListener {

	private LinearLayout ll_friendcircle;

	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		return inflater.inflate(R.layout.fragment_home, container, false);
	}

	@Override
	public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onViewCreated(view, savedInstanceState);

		ll_friendcircle = (LinearLayout) view
				.findViewById(R.id.ll_home_friendcircle);
		ll_friendcircle.setOnClickListener(this);

	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.ll_home_friendcircle:
			Intent intent = new Intent(getActivity(),
					FriendsCircleActivity.class);
			startActivity(intent);

			break;
		default:
			break;
		}
	}
	
	@Override
	public void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		Yuanjin.friendsShowItemList.clear();//清空朋友圈中的数据
	}

}
